// pre
// var baseUrl = 'http://xiechang2-fat.sfrog.cn:8190'
// var socketUrl = 'ws://119.3.152.95:8190/pcScreen/webSocket/'
// uat
// var baseUrl = 'http://xiechang2.xiechang.com:8189'
// var socketUrl = 'ws://129.211.102.233:8189/pcScreen/webSocket/'
// var socketUrl2 = 'ws://129.211.102.233:8189/webSocket/randomToken/'

// k8s部署(接口走管理端，socket走数用户端)
var baseUrl = 'http://175.24.141.4'
var socketUrl = 'ws://175.24.142.22/pcScreen/webSocket/'
var socketUrl2 = 'ws://175.24.142.22/webSocket/randomToken/'

// pre
// var baseUrl = 'http://xiechang2.sfrog.cn:8189'
// var socketUrl = ''
// prod
// var baseUrl = 'http://xcloudadmin.xiechang.com:8190'
// var socketUrl = 'ws://129.211.118.178:8190/pcScreen/webSocket/'

function getUrlParams(name) {
  var params = {};
  location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (str, key, value) {
    params[key] = value;
  });
  return params[name] || ''
}

// 将前100条数据与后100条数据，取交集合并
function mergeData(previousData, newData) {
  // 将上次的数据与新数据合并
  const mergedData = [...previousData, ...newData];

  // 根据 fullDataTime 去重
  const uniqueData = mergedData.reduce((acc, current) => {

    const x = acc.find(item => {
      return item.fullDataTime === current.fullDataTime
    });
    if (!x) {
      acc.push(current);
    }
    return acc;
  }, []);

  return uniqueData;
}
